/*
* Conditions Of Use
*
* This software was developed by employees of the Sigmatrix(Beijing) Corporation.
* This software is provided by sigmatrix as a service and is expressly
* provided "AS IS."  Sigmatrix MAKES NO WARRANTY OF ANY KIND, EXPRESS, IMPLIED
* OR STATUTORY, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTY OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT
* AND DATA ACCURACY.  Sigmatrix does not warrant or make any representations
* regarding the use of the software or the results thereof, including but
* not limited to the correctness, accuracy, reliability or usefulness of
* the software.
*
* Permission to use this software is contingent upon your acceptance
* of the terms of this agreement.
*
*/
package com.sigmatrix.h5.dao;

import java.util.List;
import java.util.Map;

import com.sigmatrix.h5.dao.impl.common.BaseDao;
import com.sigmatrix.h5.entity.InStorage;
import com.sigmatrix.h5.exception.DaoException;

/**
 *@ClassName: InStorageDao
 *@Description: 入库单数据库操作接口
 *@author youjun
 *@date 2017-07-06 14:18:28
 */
public interface InStorageDao extends BaseDao<InStorage> {
	
	/**
	 *@Title: update
	 *@Description: 更新主要入库单的包装数量和单品数量
	 *@return int
	 *@date 2017年9月27日 下午5:56:24
	 *@param eseCode
	 *@param inStorageId
	 *@param actNum  
	 *@param actSpNum
	 *@param status
	 *@throws DaoException
	 */
	int update(final String eseCode,final InStorage inStorage,final Integer actNum,final Integer actSpNum,final Integer status) throws DaoException;
	/**
	 * 
	 *@Title: update
	 *@Description: TODO()
	 *@return int
	 *@author gaomingkai
	 *@date 2018年3月21日 下午5:42:33
	 *@param eseCode
	 *@param inStorage
	 *@param actNum
	 *@param actSpNum
	 *@param status
	 *@param planNum
	 *@param planSpNum
	 *@return
	 *@throws DaoException
	 */
	int update(final String eseCode,final InStorage inStorage,final Integer actNum,final Integer actSpNum,final Integer status,final Integer planNum,final Integer planSpNum) throws DaoException;
	

	/**
	 *@Title: findById
	 *@Description: 根据主键查找入库单
	 *@return InStorage
	 *@author youjun
	 *@date 2017-07-06 14:18:28
	 *@param id
	 *@param eseCode
	 *@throws DaoException 
	 */
	InStorage findById(final Long id, final String eseCode) throws DaoException;
	
	/**
	 *@Title: findByOrderCode
	 *@Description: 根据入库单号查询
	 *@return InStorage
	 *@date 2017年9月14日 上午12:20:06
	 *@param orderCode
	 *@param eseCode
	 *@throws DaoException
	 */
	InStorage findByOrderCode(final String orderCode, final String eseCode) throws DaoException;
	
	/**
	 *@Title: save
	 *@Description: 保存入库单,返回保存后的入库单主键
	 *@return int
	 *@author youjun
	 *@date 2017-07-06 14:18:28
	 *@param inStorage
	 *@param enterpriseCode
	 *@return
	 *@throws DaoException 
	 */
	int save(final InStorage inStorage, final String enterpriseCode) throws DaoException;

	/**
	 *@Title: findByPage
	 *@Description: 分页查询入库单列表
	 *@return List<inStorage>
	 *@author youjun
	 *@date 2017-07-06 14:18:28
	 *@param pageNo
	 *@param pageSize
	 *@param inStorage
	 *@param otherParamMap 其他参数
	 *@param enterpriseCode
	 *@return
	 */
	List<InStorage> findByPage(final int pageNo, final int pageSize, InStorage inStorage, 
			Map<String, Object> otherParamMap, final String enterpriseCode) throws DaoException;
	/**
	 * 
	 *@Title: findByPage
	 *@Description: TODO()
	 *@return List<InStorage>
	 *@author gaomingkai
	 *@date 2018年1月23日 上午10:18:22
	 *@param pageNo
	 *@param pageSize
	 *@param inStorage
	 *@param otherParamMap
	 *@param enterpriseCode
	 *@param userId
	 *@return
	 *@throws DaoException
	 */
	List<InStorage> findByPage(final int pageNo, final int pageSize, InStorage inStorage, 
			Map<String, Object> otherParamMap, final String enterpriseCode,final Integer userId) throws DaoException;
	
	/**
	 *@Title: getCountByCondition
	 *@Description: 根据条件查询入库单总数
	 *@return int
	 *@author youjun
	 *@date 2017-07-06 14:18:28
	 *@param inStorage
	 *@return
	 */
	int getCountByCondition(final InStorage inStorage, final Map<String, Object> otherParamsMap, final String enterpriseCode) throws DaoException;
	/**
	 * 
	 *@Title: getCountByCondition
	 *@Description: TODO()
	 *@return int
	 *@author gaomingkai
	 *@date 2018年1月23日 上午10:29:33
	 *@param inStorage
	 *@param otherParamsMap
	 *@param enterpriseCode
	 *@return
	 *@throws DaoException
	 */
	int getCountByCondition(final InStorage inStorage, final Map<String, Object> otherParamsMap, final String enterpriseCode,final Integer userId) throws DaoException;
	
	/**
	 *@Title: findListByCondition
	 *@Description: 根据条件查找入库单列表
	 *@return List<InStorage>
	 *@author youjun
	 *@date 2017-07-06 14:18:28
	 *@param inStorage
	 *@param enterpriseCode
	 *@return
	 *@throws DaoException
	 */
	List<InStorage> findListByCondition(final InStorage inStorage, final String enterpriseCode) throws DaoException;

	/**
	 *@Title: findForSync
	 *@Description: TODO()
	 *@return List<InStorage>
	 *@date 2017年9月10日 下午8:15:49
	 *@param eseCode
	 *@param dealerId
	 *@throws DaoException
	 */
	List<InStorage> findForSync(final String eseCode,final Integer dealerId,final Short channlType) throws DaoException;
	/**
	 * 
	 *@Title: findForSync
	 *@Description: TODO()
	 *@return List<InStorage>
	 *@author gaomingkai
	 *@date 2018年1月22日 下午9:54:46
	 *@param eseCode
	 *@param dealerId
	 *@param channlType
	 *@param userId
	 *@return
	 *@throws DaoException
	 */
	List<InStorage> findForSync(final String eseCode,final Integer dealerId,final Short channlType,final Integer userId) throws DaoException;

	/**
	 *@Title: close
	 *@Description: 关闭入库单
	 *@return int
	 *@author youjun
	 *@date 2017年8月23日 下午5:17:55
	 *@param inStorageId
	 *@param enterpriseCode
	 */
	int close(Long id, String enterpriseCode) throws DaoException;
}
